home *** CD-ROM | disk | FTP | other *** search
/ New Masters of Flash / New Masters of Flash.iso / pc / MOVIES / 15.dir / 00132_Text_text11.txt < prev    next >
Text File  |  2000-10-01  |  1KB  |  11 lines

  1. This next piece of ActionScript will give Menu Item a random position on the screen once Auto Build has created it. The random location script looks like this:
  2.  
  3. setProperty (ΓÇ£ΓÇ¥, _x, random (400));
  4. setProperty (ΓÇ£ΓÇ¥, _y, random (400));
  5.  
  6. Target ΓÇ£ΓÇ¥ means ΓÇÿthis movie clipΓÇÖ, so it allows movie clips to apply actions to themselves without specifying an external address. So this script simply applies the movie clipΓÇÖs own x and y positions to a random number from 1 to 400. 
  7.  
  8. When the menu items are spawned, they will be spread randomly across the screen.
  9. The next piece of script is an attraction script that tells each menu item to gravitate towards its predecessor. So, 5 will move towards 4, 4 will move towards 3, 3 will move towards 2, and so on, creating a chain of attraction. WeΓÇÖll also create a draggable anchor point, IΓÇÖll call it 0 (the bottom of the chain) to serve as our drag menu tab. When 0 is dragged, the menu will follow in a smooth, wave-like chain reaction.
  10.     
  11.